<h3><?php echo $this->title?></h3>
<div class="upload-image">
<div style="color:red;" id="message"><?php echo $this->errMessage;?></div>
<a href="/admin/subscriber/list" style="font-weight: bold" class="btn">Danh sách đăng ký</a>
<a href="/admin/subscriber/send-mail" style="font-weight: bold" class="btn">Gửi mail mới</a>
<?php if(is_array($this->items)) {?>
    <table class="table table-bordered table-striped">
        <thead>
              <tr>
                <th>Subject</th>
                <th>Content</th>
                <th><a href="<?php echo $this->currentUrl?>&sort_by=last_update&sort_dir=<?php echo $this->sortDir^1?>">Ngày cập nhật<?php if($this->sortBylast_update) {?><i class="<?php echo $this->clzzSort?>"></i><?php }?></a></th>
                <th><a href="<?php echo $this->currentUrl?>&sort_by=dateline&sort_dir=<?php echo $this->sortDir^1?>">Ngày tạo<?php if($this->sortBydateline) {?><i class="<?php echo $this->clzzSort?>"></i><?php }?></a></th>
                <th>Thao tác</th>
              </tr>
        </thead>
        <tbody>
            <?php foreach($this->items as $item) :?>
             <tr>
                 <td style="width: 20%"><?php echo $item['name']?></td>
                 <td><?php echo $item['content']?></td>
                 <td><?php echo date('d/m/Y H:i:s', $item['last_update'])?></td>
                 <td><?php echo date('d/m/Y H:i:s', $item['dateline'])?></td>
                 <td>
                     <a href="/admin/subscriber/send-mail/id/<?php echo $item['id']?>">
                         <i class="icon-edit"></i>
                     </a>
                     <a href="/admin/subscriber/delete-newsletter/id/<?php echo $item['id']?>" onclick="return confirm('Are you sure?');">
                         <i class="icon-remove"></i>
                     </a>
                 </td>
             </tr>
             <?php endforeach;?>
        </tbody>
      </table>
      <?php echo $this->paginationcontrol2($this->page, $this->totalItem, $this->numRowPerPage, 'pagination.phtml', $this->currentUrl);?>
</div>
<?php } else {?>
<div>Không có newsletter nào!</div>
<?php }?>
